import ResMgr from "./ResMgr";

const {ccclass, property} = cc._decorator;

@ccclass
export default class SceneMgr extends cc.Component {

    public static Instance: SceneMgr = null;
    onLoad () {
        if(SceneMgr.Instance !== null) {
            this.destroy();
            return;
        }
        SceneMgr.Instance = this;
    }

    start () {

    }

    public Init(): void {
        console.log("========SceneMgr Init================")
    }
    
    public EnterScene(sceneName): void {
        cc.director.loadScene(sceneName);
    }

    public async IE_RunScene(sceneName: string, scenesBundelName: string = 'Scenes'){
        var sceneData = await ResMgr.Instance.IE_GetScene(scenesBundelName,sceneName);
        cc.director.runScene(sceneData);
    }
    // update (dt) {}
}
